import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: "/",
    component: ()=>import('~/layouts/admin.vue'),
    // 子路由
    children:[
      {
        path: "/",
        component: ()=>import('~/pages/index.vue'),
        meta:{
          title:'后台首页'
        },
      },
      {
        path: "/goods/list",
        component: ()=>import('~/pages/goods/list.vue'),
        meta:{
          title:'商品管理'
        },
      },
      {
        path: "/category/list",
        component: ()=>import('~/pages/category/list.vue'),
        meta:{
          title:'分类列表'
        },
      }
    ]
  },
  {
    path: "/Login",
    meta:{
      title:'登录页'
    },
    component: ()=>import('~/pages/login.vue'),
  },
 
  {
    path: '/:pathMatch(.*)*',
    component: ()=>import('~/pages/404.vue'),
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
